Skip to content

Conversation

lantoli
Copy link
Collaborator

@lantoli lantoli commented Sep 10, 2025

Description

Support region_configs without dynamic block inside a replication_specs with dynamic blocks.

Also:

  • Clarify that some comments and formatting may not be preserved

Link to any related issue(s): CLOUDP-344279

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@github-actions github-actions bot added the enhancement New feature or request label Sep 10, 2025
return dynamicBlock{}, nil
}

repSpecb := hclwrite.NewEmptyFile().Body()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I believe this drops any user comments in the block, is that correct? if yes, that's probably ok for a converter but maybe we should mention in the docs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maastha this is also happening in other places, good idea about mentioning, WDYT about this: 7584850

@lantoli lantoli marked this pull request as ready for review September 11, 2025 08:08
@lantoli lantoli requested a review from a team as a code owner September 11, 2025 08:08
@Copilot Copilot AI review requested due to automatic review settings September 11, 2025 08:08
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for region_configs without dynamic blocks inside replication_specs that use dynamic blocks. This enhancement allows mixed usage patterns where replication_specs are generated dynamically but region_configs within them are static. The changes also clarify that some comments and formatting may not be preserved during conversion.

  • Refactors conversion logic to handle static region_configs within dynamic replication_specs
  • Extracts common functionality into shared helper functions
  • Updates documentation to clarify formatting preservation limitations

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/e2e/e2e_helper.go Adds Atlas CLI storage warning suppression before tests
internal/convert/testdata/ Adds test cases demonstrating dynamic replication_specs with static region_configs
internal/convert/shared.go Extracts common helper functions for code reuse across converters
internal/convert/clu2adv.go Refactors to use shared helpers and handle mixed dynamic/static patterns
internal/convert/adv2v2.go Refactors to use shared helpers and handle mixed dynamic/static patterns
docs/ Updates documentation to clarify formatting and comment preservation
Comments suppressed due to low confidence (1)

internal/convert/adv2v2.go:1

  • The read_only_specs block is missing from the converted output in the 'multiple_config' resource, but it exists in the input file. This indicates the conversion logic may not be properly handling read_only_specs when processing static region_configs within dynamic replication_specs.
package convert

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@lantoli lantoli merged commit f23bb1d into main Sep 11, 2025
7 checks passed
@lantoli lantoli deleted the CLOUDP-344279_dynamic_block_rep_specs_no_configs branch September 11, 2025 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants